home *** CD-ROM | disk | FTP | other *** search
- // ViRC 2.0 default toolbar library
-
- Name ViRC 2.0 Standard Toolbars
-
- // *** IMPORTANT ***
- // If you edit this file with a text editor, make sure ALL your toolbar and
- // item definitions are either BEFORE or AFTER all other code. Otherwise the
- // script editor may lose them.
- //
- // Toolbar <name> "<title>" FOR <windowtypes> <position> ORDER <order> [HIDDEN]
- // <name> [HOTKEY <hotkey>] [MENU/COMBO <menutree>] [GROUP <num>['?']['!']] <state> ["<glyph.bmp>"] [<caption>] [ | <hint>]
- // ...
- // EndToolbar
- //
- // <windowtypes> = <windowtype>[,<windowtype>,<windowtype>...]
- // <windowtype> = {virc,servers,channels,queries,chats,whiteboards}
- // <position> = DOCKED {top,bottom,left,right} | FLOATING <x>,<y>,<w>,<h>
- // <order> = {first,last,before <name>,after <name>}
- // <state> = {0=enabled btn,1=enabled when opped,2=disabled when opped,3=disabled btn,4=edit box}
- //
- // 'menu <tree>' makes the button into a dropdown menu.
- // 'combo <tree>' splits it, where the left side is a button and the right side is a menu.
- //
- // 'group 1?' allows all the buttons in the group to be up at once.
- // 'group 1!' means this button is down by default. 'group 1?!' means both.
- // a single-button group can be toggled if the ? is given, otherwise only the script can change it.
- //
- // a state of 1/2 makes the item enabled/disabled...
- // virc - if any server windows are open
- // servers - if you are connected
- // channels - if you are opped
- // queries - always
- // chats/whiteboards - if the connection is open
-
- // ToolbarItem <itemname> ON <barname>
- // <code>
- // EndToolbarItem
- //
- // $C is the active window, $1- is any nicks selected if the window is a channel.
- // unlike menu items, main toolbar items will be run on the active window's
- // interpreter if there is an active window.
-
- // ShowToolbar <windowname>:<barname>
- // HideToolbar <windowname>:<barname>
- // DockToolbar <windowname>:<barname> = <dockpos>
- // FloatToolbar <windowname>:<barname> = <x>,<y>,<w>,<h>
-
- // SetToolbar <windowname>:<barname> <itemname>.<property> = <value>
- // $GetToolbar(<windowname>:<barname> <itemname>.<property>)
- //
- // <property> = {Enabled,Caption,Down}
-
- // $MapToolbar(<windowname>:<toolbarname>[:<itemname>])
-
- // TStrings.LoadFromToolbar <barname>
- // $TStrings.LoadFromToolbar(<barname>) returns options
- // TStrings.SaveToToolbar <barname> <options>
- // TStrings.LoadFromToolbarItem <itemname> ON <barname>
- // TStrings.SaveToToolbarItem <itemname> ON <barname>
-
- With > localized_toolbar TB_MAIN "Main toolbar" for virc docked top order first
- T_START hotkey Ctrl+S 0 "tbstart.bmp" @@Msg_TB_Main_StartDesc
- T_SEP1 0 -
- T_CONFIG 0 "tbconfig.bmp" @@Msg_TB_Main_ConfigDesc
- T_SERVLIST 0 "tbservlist.bmp" @@Msg_TB_Main_ServListDesc
- T_SCRIPTED 0 "tbscript.bmp" @@Msg_TB_Main_ScriptEdDesc
- T_REHASH 0 "tbrehash.bmp" @@Msg_TB_Main_RehashDesc
- T_SEP2 0 -
- T_TILE 0 "tbtile.bmp" @@Msg_TB_Main_TileDesc
- T_CASCADE 0 "tbcascade.bmp" @@Msg_TB_Main_CascadeDesc
- T_INFLATE 0 "tbinflate.bmp" @@Msg_TB_Main_InflateDesc
- T_SEP3 0 -
- T_EXIT 0 "tbexit.bmp" @@Msg_TB_Main_ExitDesc
- EndWith
-
- ToolbarItem T_START on TB_MAIN
- NewServerWindow
- EndToolbarItem
-
- ToolbarItem T_CONFIG on TB_MAIN
- ShowClientSetup
- EndToolbarItem
-
- ToolbarItem T_SERVLIST on TB_MAIN
- ShowServerList
- EndToolbarItem
-
- ToolbarItem T_SCRIPTED on TB_MAIN
- ShowScriptEditor
- EndToolbarItem
-
- ToolbarItem T_REHASH on TB_MAIN
- *Rehash
- EndToolbarItem
-
- ToolbarItem T_TILE on TB_MAIN
- 0.Tile
- EndToolbarItem
-
- ToolbarItem T_CASCADE on TB_MAIN
- 0.Cascade
- EndToolbarItem
-
- ToolbarItem T_INFLATE on TB_MAIN
- Inflate
- EndToolbarItem
-
- ToolbarItem T_EXIT on TB_MAIN
- Exit
- EndToolbarItem
-
- With > localized_toolbar TB_SERVER "Server toolbar" for servers docked top order first
- T_CONNECT 2 "tbconnect.bmp" @@Msg_TB_Serv_ConnectDesc
- T_DISCONNECT 1 "tbdisconnect.bmp" @@Msg_TB_Serv_DisconnectDesc
- T_SEP1 0 -
- T_LINKS 1 "tblinks.bmp" @@Msg_TB_Serv_LinksDesc
- T_LIST 1 "tblist.bmp" @@Msg_TB_Serv_ListDesc
- EndWith
-
- ToolbarItem T_CONNECT on TB_SERVER
- Connect
- EndToolbarItem
-
- ToolbarItem T_DISCONNECT on TB_SERVER
- Disconnect
- EndToolbarItem
-
- ToolbarItem T_LINKS on TB_SERVER
- Links
- EndToolbarItem
-
- ToolbarItem T_LIST on TB_SERVER
- @l $mask = $?="$Msg_TB_ListPattern"
- if ([$mask] != [INPUT_CANCELLED])
- List $mask
- endif
- EndToolbarItem
-
- With > localized_toolbar TB_CHANNEL "Channel toolbar" for channels docked top order first
- T_PART 0 "tbpart.bmp" @@Msg_TB_Chan_PartDesc
- T_CYCLE 0 "tbcycle.bmp" @@Msg_TB_Chan_CycleDesc
- T_SEP1 0 -
- T_CHANCTL 0 "tbchanctl.bmp" @@Msg_TB_Chan_ChanCtlDesc
- EndWith
-
- ToolbarItem T_PART on TB_CHANNEL
- Part $C
- EndToolbarItem
-
- ToolbarItem T_CYCLE on TB_CHANNEL
- Cycle $C
- EndToolbarItem
-
- ToolbarItem T_CHANCTL on TB_CHANNEL
- ChannelControl $C
- EndToolbarItem
-
- With > localized_toolbar TB_TS_LOGGING "Timestamps and logging" for servers,channels,queries,chats docked top order last
- T_STAMPS hotkey F5 group 1? 0 "tbtimestamp.bmp" @@Msg_TB_Log_StampsDesc
- T_LOGGING hotkey F6 group 2? 0 "tblogging.bmp" @@Msg_TB_Log_LoggingDesc
- EndWith
-
- ToolbarItem T_STAMPS on TB_TS_LOGGING
- // no command for timestamps, we have to map the output control
- // and set the property with OVS
- @l $enabled = $GetToolbar($C:TB_TS_LOGGING T_STAMPS.Down)
- @l $output = $mapobject($C:Output)
- @p $output.TimeStamps = $enabled
- UnmapObject $output
- EndToolbarItem
-
- ToolbarItem T_LOGGING on TB_TS_LOGGING
- @l $enabled = $GetToolbar($C:TB_TS_LOGGING T_LOGGING.Down)
- if ($enabled)
- Log open $C
- else
- Log close $C
- endif
- EndToolbarItem
-
- // events
-
- Event <OnCreateWindow_toolbars> "*"
- // map output control
- @l $obj = $mapobject($1:Output)
- Halt if $obj == -1
-
- // set state of timestamp button
- SetToolbar $1:TB_TS_LOGGING T_STAMPS.Down = $([$prop($obj.TimeStamps)] == [True])
-
- // set state of logging button
- SetToolbar $1:TB_TS_LOGGING T_LOGGING.Down = $([$prop($obj.Logging)] == [True])
-
- // unmap control
- UnmapObject $obj
- EndEvent
-
- // aliases
-
- Alias LOG
- *Log $1-
- // update toolbar status
- @l $btn = $MapToolbar($2:TB_TS_LOGGING:T_LOGGING)
- Halt if !$isobject($btn)
- @p $btn.Down = $islogging($2)
- UnmapObject $btn
- EndAlias
-
-